import request from '@/utils/request'

const headers = {
  'Content-Type': 'application/json'
}

export function getCoinList(data) {
  return request({
    url: '/coin',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export function getCoinAdd(data) {
  return request({
    url: '/coin/add',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export function closeAllCoin(data) {
  return request({
    url: '/coin/close-all-coin',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export function openAllCoin(data) {
  return request({
    url: '/coin/openAllCoin',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export function getCoinUpdateStatus(data) {
  return request({
    url: `/coin/updateStatus?coinId=${data.coinId}&status=${data.status}&type=${data.type}`,
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export function getCoinUpdate(data) {
  return request({
    url: '/coin/update',
    method: 'PUT',
    data: JSON.stringify(data),
    headers
  })
}

export function getMarketList(data) {
  return request({
    url: '/coin/marketList',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export function getMarketAdd(data) {
  return request({
    url: '/coin/market/add',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

export function getMarketUpdate(data) {
  return request({
    url: '/coin/market/update',
    method: 'PUT',
    data: JSON.stringify(data),
    headers
  })
}

export function getMarketTitle(data) {
  return request({
    url: '/coin/market/title',
    method: 'get',
    // data: JSON.stringify(data),
    // headers
  })
}

export function getOrderList(data) {
  return request({
    url: '/admin/bok/user/c2cOrderList',
    method: 'post',
    data: JSON.stringify(data),
    headers
  })
}

